package cn.jolyoulu.cmnservice.constant;


import cn.jolyoulu.common.core.constant.RedisConstant;

/**
 * @Author LuZhouJin
 * @Date 2022/5/22
 */
public class ServiceRedisConstant extends RedisConstant {

    private static final String PREFIX = "JL:SERVICE:";

    /**
     *  验证码
     */
    private static final String VERIFYCODEIMG = "VERIFYCODEIMG:%s";
    public static String getVerifycodeimg(String id){
        return PREFIX + String.format(VERIFYCODEIMG,id);
    }

    /**
     *  Token 字符串
     */
    private static final String TOKEN = "TOKEN:%s";
    public static String getToken(String userId){
        return PREFIX + String.format(TOKEN,userId);
    }

    /**
     *  用户关联角色
     */
    private static final String USER_ROLE = "USER:%s:ROLE";
    public static String getUserRole(String userId){
        return PREFIX + String.format(USER_ROLE,userId);
    }

    /**
     *  角色关联权限
     */
    private static final String ROLE_PERMISSION = "ROLE:%s:PERMISSION";
    public static String getRolePermission(String roleId){
        return PREFIX + String.format(ROLE_PERMISSION,roleId);
    }

    /**
     *  字典列表
     */
    private static final String DICT_LIST_DICTTYPE = "DICT:LIST:DICTTYPE:%s";
    public static String getDictListDicttype(String dictType){
        return PREFIX + String.format(DICT_LIST_DICTTYPE,dictType);
    }

}
